/*
 *   Copyright 2021 zzh
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.aduib.boot.common.serialization.model;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

/**
 * @description: PersonBuilder
 * @author: zzh
 * @date: 2021/10/13 15:49
 */
public class PersonBuilder {

    public static Person2 build(){
        Person2 testClass2 = new Person2();
        Person testClass = new Person();
        //    testClass.setId2(1);
        testClass.setId(1L);
        testClass.setName("1");
        testClass.setEnabled(true);
        testClass.setLocalDate(LocalDate.now());
        testClass.setLocalDateTime(LocalDateTime.now());
        testClass.setTime(new Date());
        testClass.setValue(BigDecimal.ONE);
        testClass.setValue2(BigInteger.TEN);

        testClass2.setPerson(testClass);

        Person[] testClassArray = {testClass};
        testClass2.setPersonArray(testClassArray);

        ArrayList<Person> testClassList = new ArrayList<>();
        testClassList.add(testClass);
        testClass2.setPersonList(testClassList);

        HashMap<String, Person> testClassMap = new HashMap<>();
        testClassMap.put("1",testClass);
        testClass2.setPersonMap(testClassMap);
        return testClass2;
    }
}
